agent: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.#1594
agent: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.#1594sweetmantech wants to merge 1 commit intotestfrom
Conversation
- lib/sandboxes/uploadFilesToSandbox.ts: client-side API call to POST /api/sandboxes/files - hooks/useUploadSandboxFiles.ts: React hook wrapping upload with loading/error state - components/Sandboxes/SandboxFileTree.tsx: drag-and-drop zone using useDragAndDrop, uploads to currently selected folder, refreshes tree on success Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 927f45194f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!resolvedDropFolder) { | ||
| toast.error("No folder selected. Select a file or folder first."); | ||
| return; |
There was a problem hiding this comment.
Allow drops when the repository tree is empty
This guard makes the new empty-state drop zone unusable. In the filetree.length === 0 branch we still mount getRootProps() (components/Sandboxes/SandboxFileTree.tsx:94-99), but resolvedDropFolder can only come from dropFolder, selectedPath, or getFirstFolderPath(filetree). When the tree is empty all three are "", so every drop immediately returns here with "No folder selected". That means a brand-new org repo cannot be populated via drag-and-drop at all.
Useful? React with 👍 / 👎.
| const parent = getParentFolder(path); | ||
| if (parent) setDropFolder(parent); |
There was a problem hiding this comment.
Target the selected folder instead of its parent
FileTreeFolder forwards its own folder path to onSelect (components/ai-elements/file-tree.tsx:131-133), but this handler always converts the selection to getParentFolder(path). As soon as a user clicks a nested folder like org/assets, the drop target becomes org, so uploads land in the parent directory instead of the folder they picked. It also makes empty folders impossible to target, because there is no file inside them to select first.
Useful? React with 👍 / 👎.
| } catch (err) { | ||
| const message = err instanceof Error ? err.message : "Upload failed"; | ||
| setError(message); | ||
| return []; |
There was a problem hiding this comment.
Propagate request-level upload failures to the UI
SandboxFileTree.handleDrop only renders failure toasts for entries returned in results (components/Sandboxes/SandboxFileTree.tsx:52-63), but this catch block swallows auth/network/5xx failures and returns []. In those cases the loading toast is dismissed and the user sees no error at all, so a broken upload path looks like a no-op. Re-throwing here, or returning a synthetic failed result, would keep those failures visible.
Useful? React with 👍 / 👎.
Automated PR from coding agent.
Prompt: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.
• actual: I am unable to drag and drop files on the /files page to add them to my github repository in an org submodule.
• required: I can drag and drop files on the /files page to add them to my github repository in an org submodule.